Managing a grouping window on an operator graph

ABSTRACT

Embodiments of the disclosure provide a method, system, and computer program product for managing a windowing operation. The method can include determining a sentinel value that defines a start of a grouping window for a stream of tuples and a terminating sentinel value that defines the end of the grouping window based upon an attribute contained in the stream of tuples. The stream of tuples can be monitored for the sentinel value and the terminating sentinel value by a stream operator. The stream operator can initiate a windowing operation that defines the start of the grouping window in response to a presence of the sentinel value and terminate the windowing operation in response to a presence of the terminating sentinel value.

FIELD

This disclosure generally relates to stream computing, and inparticular, to computing applications that receive streaming data andprocess the data as it is received.

BACKGROUND

Database systems are typically configured to separate the process ofstoring data from accessing, manipulating, or using data stored in adatabase. More specifically, database systems use a model in which datais first stored and indexed in a memory before subsequent querying andanalysis. In general, database systems may not be well suited forperforming real-time processing and analyzing streaming data. Inparticular, database systems may be unable to store, index, and analyzelarge amounts of streaming data efficiently or in real time.

SUMMARY

Embodiments of the disclosure provide a method, system, and computerprogram product for processing data. The method, system, and computerprogram product receive two or more tuples to be processed by aplurality of processing elements operating on one or more computerprocessors.

Various embodiments are directed toward a method for grouping processingof a stream of tuples with each tuple containing one or more attributes.The method can include receiving the stream of tuples to be processed bya plurality of processing elements operating on one or more computerprocessors. The method can also include determining a sentinel valuethat defines a start of a grouping window for the stream of tuples and aterminating sentinel value that defines an end of the grouping windowbased upon the attribute contained in the stream of tuples. The methodcan also include monitoring the stream of tuples for the sentinel valueand the terminating sentinel value. The method can also includeinitiating a windowing operation that defines the start of the groupingwindow at the processing element from the one or more processingelements in response to detecting a presence of the sentinel value. Themethod can also include terminating the windowing operation at theprocessing element in response to detecting a presence of theterminating sentinel value.

Various embodiments are also directed toward a system and a computerprogram product for processing a stream of tuples.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates a computing infrastructure configured to execute astream computing application according to various embodiments.

FIG. 2 illustrates a more detailed view of a compute node of FIG. 1according to various embodiments.

FIG. 3 illustrates a more detailed view of the management system of FIG.1 according to various embodiments.

FIG. 4 illustrates a more detailed view of the compiler system of FIG. 1according to various embodiments.

FIG. 5 illustrates an operator graph for a stream computing applicationaccording to various embodiments.

FIG. 6 illustrates a flowchart of a method for implementing a windowingoperation based on a sentinel value, according to various embodiments.

FIG. 7 illustrates a flowchart of a method of determining a sentinelvalue, according to various embodiments.

FIG. 8 illustrates a block diagram of an operator graph that implementsa windowing operation in response to a sentinel value, according tovarious embodiments.

Like reference numbers and designations in the various drawings indicatelike elements.

DETAILED DESCRIPTION

Aspects of the present disclosure are generally directed to determininga sentinel value that defines a start of a grouping window for a streamof tuples and a terminating sentinel value that defines the end of thegrouping window based upon an attribute contained in a stream of tuples.The stream of tuples can be monitored for the sentinel value and theterminating sentinel value by a stream operator. The stream operator caninitiate a windowing operation that defines the start of the groupingwindow in response to the presence of the sentinel value and terminatethe windowing operation in response to the presence of the terminatingsentinel value.

Although not necessarily limited thereto, embodiments of the presentdisclosure can be appreciated in the context of streaming data andproblems relating to indicative elements that process the stream ofdata. Throughout this disclosure, the term stream operator may beabbreviated “S.O.”

Stream-based computing and stream-based database computing are emergingas a developing technology for database systems. Products are availablewhich allow users to create applications that process and querystreaming data before it reaches a database file. With this emergingtechnology, users can specify processing logic to apply to inbound datarecords while they are “in flight,” with the results available in a veryshort amount of time, often in fractions of a second. Constructing anapplication using this type of processing has opened up a newprogramming paradigm that will allow for development of a broad varietyof innovative applications, systems, and processes, as well as presentnew challenges for application programmers and database developers.

In a stream computing application, stream operators are connected to oneanother such that data flows from one stream operator to the next (e.g.,over a TCP/IP socket). When a stream operator receives data, it mayperform operations, such as analysis logic, which may change the tupleby adding or subtracting attributes, or updating the values of existingattributes within the tuple. When the analysis logic is complete, a newtuple is then sent to the next stream operator. Scalability is achievedby distributing an application across nodes by creating executables(i.e., processing elements), as well as replicating processing elementson multiple nodes and load balancing among them. Stream operators in astream computing application can be fused together to form a processingelement that is executable. Doing so allows processing elements to sharea common process space, resulting in much faster communication betweenstream operators than is available using inter-process communicationtechniques (e.g., using a TCP/IP socket). Further, processing elementscan be inserted or removed dynamically from an operator graphrepresenting the flow of data through the stream computing application.A particular stream operator may not reside within the same operatingsystem process as other stream operators. In addition, stream operatorsin the same operator graph may be hosted on different nodes, e.g., ondifferent compute nodes or on different cores of a compute node.

Data flows from one stream operator to another in the form of a “tuple.”A tuple is a sequence of one or more attributes associated with anentity. Attributes may be any of a variety of different types, e.g.,integer, float, Boolean, string, etc. The attributes may be ordered. Inaddition to attributes associated with an entity, a tuple may includemetadata, i.e., data about the tuple. A tuple may be extended by addingone or more additional attributes or metadata to it. As used herein,“stream” or “data stream” refers to a sequence of tuples. Generally, astream may be considered a pseudo-infinite sequence of tuples.

Nonetheless, an output tuple may be changed in some way by a streamoperator or processing element. An attribute or metadata may be added,deleted, or modified. For example, a tuple will often have two or moreattributes. A stream operator or processing element may receive thetuple having multiple attributes and output a tuple corresponding withthe input tuple. The stream operator or processing element may onlychange one of the attributes so that all of the attributes of the outputtuple except one are the same as the attributes of the input tuple.

Generally, a particular tuple output by a stream operator or processingelement may not be considered to be the same tuple as a correspondinginput tuple even if the input tuple is not changed by the processingelement. However, to simplify the present description and the claims, anoutput tuple that has the same data attributes or is associated with thesame entity as a corresponding input tuple will be referred to herein asthe same tuple unless the context or an express statement indicatesotherwise.

Stream computing applications handle massive volumes of data that needto be processed efficiently and in real time. For example, a streamcomputing application may continuously ingest and analyze hundreds ofthousands of messages per second and up to petabytes of data per day.Accordingly, each stream operator in a stream computing application maybe required to process a received tuple within fractions of a second.Unless the stream operators are located in the same processing element,it is necessary to use an inter-process communication path each time atuple is sent from one stream operator to another. Inter-processcommunication paths can be a critical resource in a stream computingapplication. According to various embodiments, the available bandwidthon one or more inter-process communication paths may be conserved.Efficient use of inter-process communication bandwidth can speed upprocessing.

A stream computing application can process tuples within a window in awindowing operation. The windowing operation can be the process offorming the window from a stream of tuples. The window can refer to agroup of tuples that are analyzed together. The window can also bereferred to as a grouping window since the window groups together tuplesfrom the stream of tuples. Both the terms “grouping window” and “window”can be used interchangeably throughout this disclosure. The group oftuples can be defined through either a fixed amount of time or can bedefined by data within some relationship to other data, e.g., a spatialrelationship. In streams computing, one type of spatial relationship canbe done thru a windowing operation of a given stream operator. Thewindow can be the same size as other windows within a stream of tuplesor each window size can be variable.

A beginning, or start, and end of a window in the windowing operationcan be defined in a number of ways, e.g., the predetermined size of thewindow, a period of time, a punctuation marker in the stream, or theattribute values for the tuples in a window. In various embodiments,where the attribute values are used to define the beginning and end of awindow, the windowing operation can also be initiated by a sentinelvalue. A stream operator can monitor the stream of tuples for thesentinel value to determine the size of the window.

A sentinel value can generally be an indication of the beginning of awindow while a terminating sentinel value is generally an indication ofthe end of a window. The sentinel value can be a particular attributevalue. A stream operator can apply one or more actions in response tothe sentinel value. For example, once the sentinel value is detected, astream operator can implement an action that implements a windowingoperation before performing a processing operation on the window.

A sentinel value can be defined by more than one attribute value. Forexample, a sentinel value can be defined by a particular tuple thatincludes an attribute value of “Pine” for the attribute of “Tree” and anattribute value of “Mountain” for the attribute of “Location”.

In various embodiments, a sentinel value can be defined by more than oneattribute value in different tuples. For example, the sentinel value canbe an initiation condition when the attribute value for the attribute“Tree” is “Juniper”, then “Pine”. A reading of a first tuple with theattribute value of “Juniper” and a second tuple with the attribute valueof “Pine” can be the sentinel value.

A terminating sentinel value can be used to trigger the termination ofthe grouping window and can be an attribute read from the stream oftuples. The terminating sentinel value can be the same or different thanthe sentinel value. If the sentinel value is the same as the terminatingsentinel value, then the terminating sentinel value can be based on afunction of the number of times the sentinel value appears. For example,if the sentinel value is a particular attribute value, then theterminating sentinel value can be 12 instances of the sentinel value.Embodiments of the disclosure can be directed toward a method topopulate and initiate a windowing operation using sentinel valuescontained in the tuples of a stream.

FIG. 1 illustrates one exemplary computing infrastructure 100 that maybe configured to execute a stream computing application, according tosome embodiments. The computing infrastructure 100 includes a managementsystem 105 and two or more compute nodes 110A-110D—i.e., hosts—which arecommunicatively coupled to each other using one or more communicationsnetworks 120. The communications network 120 may include one or moreservers, networks, or databases, and may use a particular communicationprotocol to transfer data between the compute nodes 110A-110D. Acompiler system 102 may be communicatively coupled with the managementsystem 105 and the compute nodes 110 either directly or via thecommunications network 120.

The management system 105 can control the management of the computenodes 110A-110D (discussed further on FIG. 3). The management system 105can have an operator graph 132 with one or more stream operators and astream manager 134 to control the management of the stream of tuples inthe operator graph 132. The stream manager 134 can have components suchas a stream operator monitor 140 and a windowing manager 145. The streamoperator monitor 140 can monitor an attribute of a particular tuple fromthe stream of tuples and communicate the attribute to the stream manager134, according to various embodiments. The windowing manager 145 canmanage determination of a sentinel value and a terminating sentinelvalue.

In various embodiments, a stream operator can communicate with thestream operator monitor 140 that a sentinel value has been identified.The stream operator monitor 140 can monitor the stream of tuples at oneor more of the stream operators. Various embodiments of the disclosurecan be directed toward specific types of stream operators, e.g.,aggregate stream operators or counting stream operators. The streamoperator monitor 140 can further communicate to the windowing manager145 and request that the windowing manager 145 allow the stream operatorto initiate a windowing operation.

In various embodiments, the stream operator can access the sentinelvalue and terminating sentinel value from the windowing manager 145. Itcan be possible for the stream operator to be compiled with the sentinelvalue and terminating sentinel value. The detection of the sentinelvalue by the stream operator can result in the initiation of a windowand the detection of the terminating sentinel value by the streamoperator can result in the termination of the window. The detectingstream operator can wait on the windowing manager 145 for permission toinitiate or terminate the window, or can immediately initiate orterminate the window.

The communications network 120 may include a variety of types ofphysical communication channels or “links.” The links may be wired,wireless, optical, or any other suitable media. In addition, thecommunications network 120 may include a variety of network hardware andsoftware for performing routing, switching, and other functions, such asrouters, switches, or bridges. The communications network 120 may bededicated for use by a stream computing application or shared with otherapplications and users. The communications network 120 may be any size.For example, the communications network 120 may include a single localarea network or a wide area network spanning a large geographical area,such as the Internet. The links may provide different levels ofbandwidth or capacity to transfer data at a particular rate. Thebandwidth that a particular link provides may vary depending on avariety of factors, including the type of communication media andwhether particular network hardware or software is functioning correctlyor at full capacity. In addition, the bandwidth that a particular linkprovides to a stream computing application may vary if the link isshared with other applications and users. The available bandwidth mayvary depending on the load placed on the link by the other applicationsand users. The bandwidth that a particular link provides may also varydepending on a temporal factor, such as time of day, day of week, day ofmonth, or season.

FIG. 2 is a more detailed view of a compute node 110, which may be thesame as one of the compute nodes 110A-110D of FIG. 1, according tovarious embodiments. The compute node 110 may include, withoutlimitation, one or more processors (CPUs) 205, a network interface 215,an interconnect 220, a memory 225, and a storage 230. The compute node110 may also include an I/O device interface 210 used to connect I/Odevices 212, e.g., keyboard, display, and mouse devices, to the computenode 110.

Each CPU 205 retrieves and executes programming instructions stored inthe memory 225 or storage 230. Similarly, the CPU 205 stores andretrieves application data residing in the memory 225. The interconnect220 is used to transmit programming instructions and application databetween each CPU 205, I/O device interface 210, storage 230, networkinterface 215, and memory 225. The interconnect 220 may be one or morebusses. The CPUs 205 may be a single CPU, multiple CPUs, or a single CPUhaving multiple processing cores in various embodiments. In oneembodiment, a processor 205 may be a digital signal processor (DSP). Oneor more processing elements 235 (described below) may be stored in thememory 225. A processing element 235 may include one or more streamoperators 240 (described below). In one embodiment, a processing element235 is assigned to be executed by only one CPU 205, although in otherembodiments the stream operators 240 of a processing element 235 mayinclude one or more threads that are executed on two or more CPUs 205.The memory 225 is generally included to be representative of a randomaccess memory, e.g., Static Random Access Memory (SRAM), Dynamic RandomAccess Memory (DRAM), or Flash. The storage 230 is generally included tobe representative of a non-volatile memory, such as a hard disk drive,solid state device (SSD), or removable memory cards, optical storage,flash memory devices, network attached storage (NAS), or connections tostorage area network (SAN) devices, or other devices that may storenon-volatile data. The network interface 215 is configured to transmitdata via the communications network 120.

A stream computing application may include one or more stream operators240 that may be compiled into a “processing element” container 235. Thememory 225 may include two or more processing elements 235, eachprocessing element having one or more stream operators 240. Each streamoperator 240 may include a portion of code that processes tuples flowinginto a processing element and outputs tuples to other stream operators240 in the same processing element, in other processing elements, or inboth the same and other processing elements in a stream computingapplication. Processing elements 235 may pass tuples to other processingelements that are on the same compute node 110 or on other compute nodesthat are accessible via communications network 120. For example, aprocessing element 235 on compute node 110A may output tuples to aprocessing element 235 on compute node 110B.

The storage 230 may include a buffer 260. Although shown as being instorage, the buffer 260 may be located in the memory 225 of the computenode 110 or in a combination of both memories. Moreover, storage 230 mayinclude storage space that is external to the compute node 110, such asin a cloud.

The compute node 110 may include one or more operating systems 262. Anoperating system 262 may be stored partially in memory 225 and partiallyin storage 230. Alternatively, an operating system may be storedentirely in memory 225 or entirely in storage 230. The operating systemprovides an interface between various hardware resources, including theCPU 205, and processing elements and other components of the streamcomputing application. In addition, an operating system provides commonservices for application programs, such as providing a time function.

FIG. 3 is a more detailed view of the management system 105 of FIG. 1according to some embodiments. The management system 105 may include,without limitation, one or more processors (CPUs) 305, a networkinterface 315, an interconnect 320, a memory 325, and a storage 330. Themanagement system 105 may also include an I/O device interface 310connecting I/O devices 312, e.g., keyboard, display, and mouse devices,to the management system 105.

Each CPU 305 retrieves and executes programming instructions stored inthe memory 325 or storage 330. Similarly, each CPU 305 stores andretrieves application data residing in the memory 325 or storage 330.The interconnect 320 is used to move data, such as programminginstructions and application data, between the CPU 305, I/O deviceinterface 310, storage unit 330, network interface 315, and memory 325.The interconnect 320 may be one or more busses. The CPUs 305 may be asingle CPU, multiple CPUs, or a single CPU having multiple processingcores in various embodiments. In one embodiment, a processor 305 may bea DSP. Memory 325 is generally included to be representative of a randomaccess memory, e.g., SRAM, DRAM, or Flash. The storage 330 is generallyincluded to be representative of a non-volatile memory, such as a harddisk drive, solid state device (SSD), removable memory cards, opticalstorage, Flash memory devices, network attached storage (NAS),connections to storage area-network (SAN) devices, or the cloud. Thenetwork interface 315 is configured to transmit data via thecommunications network 120.

The memory 325 may store a stream manager 134. The stream manager 134can have software features that manage the windowing operation of astream operator. In various embodiments, the stream manager 134 may havea stream operator monitor 140, and a windowing manager 145, discussedherein.

Additionally, the storage 330 may store an operator graph 335. Theoperator graph 335 may define how tuples are routed to processingelements 235 (FIG. 2) for processing.

The management system 105 may include one or more operating systems 332.An operating system 332 may be stored partially in memory 325 andpartially in storage 330. Alternatively, an operating system may bestored entirely in memory 325 or entirely in storage 330. The operatingsystem provides an interface between various hardware resources,including the CPU 305, and processing elements and other components ofthe stream computing application. In addition, an operating systemprovides common services for application programs, such as providing atime function.

FIG. 4 is a more detailed view of the compiler system 102 of FIG. 1according to some embodiments. The compiler system 102 may include,without limitation, one or more processors (CPUs) 405, a networkinterface 415, an interconnect 420, a memory 425, and storage 430. Thecompiler system 102 may also include an I/O device interface 410connecting I/O devices 412, e.g., keyboard, display, and mouse devices,to the compiler system 102.

Each CPU 405 retrieves and executes programming instructions stored inthe memory 425 or storage 430. Similarly, each CPU 405 stores andretrieves application data residing in the memory 425 or storage 430.The interconnect 420 is used to move data, such as programminginstructions and application data, between the CPU 405, I/O deviceinterface 410, storage unit 430, network interface 415, and memory 425.The interconnect 420 may be one or more busses. The CPUs 405 may be asingle CPU, multiple CPUs, or a single CPU having multiple processingcores in various embodiments. In one embodiment, a processor 405 may bea DSP. Memory 425 is generally included to be representative of a randomaccess memory, e.g., SRAM, DRAM, or Flash. The storage 430 is generallyincluded to be representative of a non-volatile memory, such as a harddisk drive, solid state device (SSD), removable memory cards, opticalstorage, flash memory devices, network attached storage (NAS),connections to storage area-network (SAN) devices, or to the cloud. Thenetwork interface 415 is configured to transmit data via thecommunications network 120.

The compiler system 102 may include one or more operating systems 432.An operating system 432 may be stored partially in memory 425 andpartially in storage 430. Alternatively, an operating system may bestored entirely in memory 425 or entirely in storage 430. The operatingsystem provides an interface between various hardware resources,including the CPU 405, and processing elements and other components ofthe stream computing application. In addition, an operating systemprovides common services for application programs, such as providing atime function.

The memory 425 may store a compiler 136. The compiler 136 compilesmodules, which include source code or statements, into the object code,which includes machine instructions that execute on a processor. In oneembodiment, the compiler 136 may translate the modules into anintermediate form before translating the intermediate form into objectcode. The compiler 136 may output a set of deployable artifacts that mayinclude a set of processing elements and an application descriptionlanguage file (ADL file), which is a configuration file that describesthe stream computing application. In some embodiments, the compiler 136may be a just-in-time compiler that executes as part of an interpreter.In other embodiments, the compiler 136 may be an optimizing compiler. Invarious embodiments, the compiler 136 may perform peepholeoptimizations, local optimizations, loop optimizations, inter-proceduralor whole-program optimizations, machine code optimizations, or any otheroptimizations that reduce the amount of time required to execute theobject code, to reduce the amount of memory required to execute theobject code, or both. The output of the compiler 136 may be representedby an operator graph, e.g., the operator graph 335.

In various embodiments, the compiler 136 can include the windowingoperation on a particular stream operator on the operator graph 335during compile time by writing the windowing operation onto a particularstream operator. In various embodiments, the windowing operation may beincluded as a default and activated from the stream manager 134. Thewindowing operation may also be included as an optional feature for aparticular stream operator and may be activated by the application.

The compiler 136 may also provide the application administrator with theability to optimize performance through profile-driven fusionoptimization. Fusing operators may improve performance by reducing thenumber of calls to a transport. While fusing stream operators mayprovide faster communication between operators than is available usinginter-process communication techniques, any decision to fuse operatorsrequires balancing the benefits of distributing processing acrossmultiple compute nodes with the benefit of faster inter-operatorcommunications. The compiler 136 may automate the fusion process todetermine how to best fuse the operators to be hosted by one or moreprocessing elements, while respecting user-specified constraints. Thismay be a two-step process, including compiling the application in aprofiling mode and running the application, then re-compiling and usingthe optimizer during this subsequent compilation. The end result may,however, be a compiler-supplied deployable application with an optimizedapplication configuration.

FIG. 5 illustrates an exemplary operator graph 500 for a streamcomputing application beginning from one or more sources 135 through toone or more sinks 504, 506, according to some embodiments. This flowfrom source to sink may also be generally referred to herein as anexecution path. In addition, a flow from one processing element toanother may be referred to as an execution path in various contexts.Although FIG. 5 is abstracted to show connected processing elementsPE1-PE10, the operator graph 500 may include data flows between streamoperators 240 (FIG. 2) within the same or different processing elements.Typically, processing elements, such as processing element 235 (FIG. 2),receive tuples from the stream as well as output tuples into the stream(except for a sink—where the stream terminates, or a source—where thestream begins). While the operator graph 500 includes a relatively smallnumber of components, an operator graph may be much more complex and mayinclude many individual operator graphs that may be statically ordynamically linked together.

The example operator graph shown in FIG. 5 includes ten processingelements (labeled as PE1-PE10) running on the compute nodes 110A-110D. Aprocessing element may include one or more stream operators fusedtogether to form an independently running process with its own processID (PID) and memory space. In cases where two (or more) processingelements are running independently, inter-process communication mayoccur using a “transport,” e.g., a network socket, a TCP/IP socket, orshared memory. Inter-process communication paths used for inter-processcommunications can be a critical resource in a stream computingapplication. However, when stream operators are fused together, thefused stream operators can use more rapid communication techniques forpassing tuples among stream operators in each processing element.

Each processing element may have a windowing manager 145. The processingelement may further transmit or direct the stream operator to conduct awindowing operation within the processing element. The operator graph132 can encompass one or more processing elements, e.g., PE2 and PE4from FIG. 5, which may lie on more than one compute node, e.g., 110A and110B.

The operator graph 500 begins at a source 135 and ends at a sink 504,506. Compute node 110A includes the processing elements PE1, PE2, andPE3. Source 135 flows into the processing element PE1, which in turnoutputs tuples that are received by PE2 and PE3. For example, PE1 maysplit data attributes received in a tuple and pass some data attributesin a new tuple to PE2, while passing other data attributes in anothernew tuple to PE3. As a second example, PE1 may pass some received tuplesto PE2 while passing other tuples to PE3. Tuples that flow to PE2 areprocessed by the stream operators contained in PE2, and the resultingtuples are then output to PE4 on compute node 110B. Likewise, the tuplesoutput by PE4 flow to operator sink PE6 504. Similarly, tuples flowingfrom PE3 to PE5 also reach the operators in sink PE6 504. Thus, inaddition to being a sink for this example operator graph, PE6 could beconfigured to perform a join operation, combining tuples received fromPE4 and PE5. This example operator graph also shows tuples flowing fromPE3 to PE7 on compute node 110C, which itself shows tuples flowing toPE8 and looping back to PE7. Tuples output from PE8 flow to PE9 oncompute node 110D, which in turn outputs tuples to be processed byoperators in a sink processing element, for example PE10 506.

Processing elements 235 (FIG. 2) may be configured to receive or outputtuples in various formats, e.g., the processing elements or streamoperators could exchange data marked up as XML documents. Furthermore,each stream operator 240 within a processing element 235 may beconfigured to carry out any form of data processing functions onreceived tuples, including, for example, writing to database tables orperforming other database operations such as data joins, splits, reads,etc., as well as performing other data analytic functions or operations.

The stream manager 134 of FIG. 1 may be configured to monitor a streamcomputing application running on compute nodes, e.g., compute nodes110A-110D, as well as to change the deployment of an operator graph,e.g., operator graph 132. The stream manager 134 may move processingelements from one compute node 110 to another, for example, to managethe processing loads of the compute nodes 110A-110D in the computinginfrastructure 100. Further, stream manager 134 may control the streamcomputing application by inserting, removing, fusing, un-fusing, orotherwise modifying the processing elements and stream operators (orwhat tuples flow to the processing elements) running on the computenodes 110A-110D.

Because a processing element may be a collection of fused streamoperators, it is equally correct to describe the operator graph as oneor more execution paths between specific stream operators, which mayinclude execution paths to different stream operators within the sameprocessing element. FIG. 5 illustrates execution paths betweenprocessing elements for the sake of clarity.

FIG. 6 illustrates a flowchart of a method 600 for implementing awindowing operation based on a sentinel value, according to variousembodiments. Generally, the method 600 can involve finding a sentinelvalue from the stream of tuples, and using the sentinel value to triggera windowing operation. The method can also involve finding a terminatingsentinel value from the stream of tuples, and using the terminatingsentinel value to trigger a stop of the windowing operation. The size ofa window can be determined by the number of tuples between the sentinelvalue and the terminal sentinel value. The method 600 can begin atoperation 610. In operation 610, a windowing manager, e.g. the windowingmanager 145 from FIG. 1, can determine the sentinel value. In variousembodiments, the sentinel value can be determined based on applicationpreferences. The application preferences can be further defined by userinput. For example, the sentinel value for a forestry survey can be atree that indicates a particular ecosystem which could be determined bythe application. The application preferences can also be determined by asubroutine. The details of determining a sentinel value can be discussedfurther herein. After the sentinel value is determined in operation 610,then the method 600 can continue to operation 612.

In operation 612, stream operator monitor 140 can monitor the stream oftuples that are received by a stream operator in the operator graph. Thestream operator monitor 140 can have programmable code inserted intoeach stream operator through the stream manager 134. The stream operatorwith the programmable code can send the contents of every attribute tothe stream manager 134. In various embodiments, the stream operator canreceive programmable code that identifies a sentinel value that willtrigger a windowing operation. Once received, the stream operator canmonitor each tuple from the stream of tuples during the streamoperator's assigned processing function. The stream operator can readeach attribute and once the sentinel value is located, then the streamoperator can notify the stream operator monitor 140 on the streammanager 134. After operation 612, the method 600 can continue tooperation 614.

In operation 614, the stream operator monitor, e.g., stream operatormonitor 140 from FIG. 1, can determine whether there is a timing error.Timing errors can occur when a stream operator receives a first tupleafter a second tuple. For example, a first tuple that was sent from astream operator may receive a time stamp of 1200 while a second tuplethat was sent from the stream operator may receive a time stamp of 1202.The first tuple may be received by another stream operator at 1220 whilethe second tuple may be received by another stream operator at 1215, dueto network or processing latency between the stream operators thatcauses the first tuple to be delayed.

The stream operator monitor 134 can monitor the time stamp for thestream of tuples to determine whether a timing error exists. If thetiming error is detected, then the stream manager 134 can determinewhether to discard a tuple to correct the timing error based on theapplication parameters. In various embodiments, the applicationparameters can have a tolerance level for late data that can beadjusted. In various embodiments, the tolerance level can be a buffer tohold a certain number of tuples in order to rearrange the receipt of thetuples. The tolerance level can also refer to a time-based tolerancelevel where the timing error can be corrected to values within thetolerance level.

Continuing the example previously mentioned, if the tolerance level is 5minutes, then every tuple received in the last 5 minutes can be retainedin a buffer. If the second tuple used in the previous example isreceived at 1215, and the first tuple is received at 1220, then thefirst tuple is within the 5 minute tolerance level. However, if thefirst tuple is received at 1221, then the first tuple would not bewithin the 5 minute tolerance level and would be considered outside ofthe tolerance level. Assuming that the first tuple is within thetolerance level, the stream manager 134 can take the first tuple andadjust the order of the stream to ensure that the first tuple is orderedbefore the second tuple. After timing errors are corrected, the method600 can continue to operation 616.

In operation 616, the stream operator monitor 140 can determine whetherthere is a sentinel value identified. A sentinel value can be anattribute value or range of attribute values of a tuple that cause thewindowing manager to start the windowing operation. In variousembodiments, the sentinel value can be a combination of two differentattributes for a tuple. If there is not a sentinel value identified bythe stream operator monitor 140, then the method 600 can continue tooperation 612 where further monitoring can continue until a sentinelvalue is identified. In various embodiments, if a sentinel value is notdetected within a period of time, e.g., 50 minutes, then the method 600may timeout or stop. If there is a sentinel value identified, then themethod 600 can continue to operation 618.

In operation 618, the windowing manager 145 can perform a windowingoperation. As discussed herein, the windowing operation can define astart and a stop of a group of tuples. The group of tuples can have thesame calculations performed within the group. For example, if a streamoperator performs an averaging calculation, then the stream operator canuse the window of the stream of tuples to determine when the averagingstarts and when the averaging stops in stream of tuples.

In various embodiments, the sentinel value can be included in thedetermination of a window. For example, if the windowing operationtriggers on the attribute of “7”, then the presence of “7” as read bythe stream operator monitor 140 can trigger the windowing operation. Thetuple with the attribute value of “7” can either begin the windowingoperation once “7” is received or any number of tuples after. If the “7”is received, then the windowing manager 145 can start the windowingoperation after four tuples from the sentinel value to create a buffer.Alternatively, the windowing manager 145 can start the windowingoperation that includes the tuple with the sentinel value. After thewindowing operation is performed, the method 600 can continue tooperation 620.

In operation 620, the terminal sentinel value is identified by thewindowing manager 145. The terminal sentinel value, discussed herein,can be similar in concept to the sentinel value. The terminal sentinelvalue can be derived from operation 610. For example, if the sentinelvalue is a name of a tree to trigger the windowing operation, then theterminating sentinel value can be based off of a number of instances thename of the tree shows up within the window.

The terminal sentinel value can be an attribute value or range ofattribute values that causes the windowing manager 145 to cease thewindowing operation. For example, if the terminal sentinel value is arange of attribute values, and the attribute is age and the terminalvalue is a range between 40 and 50, then when a stream operator reads anattribute value of 41 the windowing operation stops. A range of sentinelvalues can work in a similar fashion. In one example, the sentinelvalues can be a range, e.g., an age range, to capture a certainmarketing demographic and terminated by the presence of another range.After the terminal sentinel value is identified in operation 620, themethod 600 can continue to operation 622.

In operation 622, the stream of tuples can be monitored for theterminating sentinel value by the stream operator using the codeprovided by the stream operator monitor 140. In various embodiments,operation 622 can occur simultaneously with operation 612. Multiplesentinel values can apply to a stream of tuples which can producemultiple windowing operations and use multiple terminating sentinelvalues to terminate the windowing operations. In various embodiments,operation 622 can be the same as operation 612. A stream operator canmonitor for both the terminating sentinel value and a sentinel valuesimultaneously. After operation 622, the method 600 can continue tooperation 624.

In operation 624, the windowing manager 145 can determine the presenceof a terminating sentinel value. If a terminating sentinel value is notpresent, then the method 600 can continue to operation 622. If aterminating sentinel value is present, then the method 600 can continueto operation 626.

In operation 626, the windowing manager 145 can stop the windowingoperation. A windowing operation can be stopped by a stream operatorreading the terminating sentinel value. Once read, the stream operatorcan transmit a signal that a terminating sentinel value was found andbroadcast the signal to the windowing manager 145. The windowing manager145 can decide to stop the windowing operation and transmit a stopsignal to the stream operator that discovered the terminating sentinelvalue. The stream operator can then stop the windowing operation. Invarious embodiments, the windowing operation can be stopped by thestream operator once the terminating sentinel value is read withoutgoing through the windowing manager 145. The stream operator can notifythe windowing manager 145 that the windowing operation is stopped for aparticular window.

FIG. 7 illustrates a flowchart of a method 700 of determining a sentinelvalue, according to various embodiments. The method 700 can correspondto operation 610 from FIG. 6. The method 700 can indicate one particularexample of an embodiment and other examples of determining a sentinelvalue are contemplated. The method 700 can begin at operation 710. Inoperation 710, the attributes of a tuple are examined by the streamoperator as they are received by the stream operator. Operation 710 canbe similar in concept to operation 612 in FIG. 6. After the attributesare examined by the stream operators, the method 700 can continue tooperation 712.

In operation 712, the frequency of the attribute can be determined bythe stream manager 134 working in conjunction with the stream operator.As the attributes are examined in operation 710, the stream operator canbe recording counts of the attributes that are read. This may occurusing a counting stream operator on a parallel path. In variousembodiments, the attribute values can be counted before they areprocessed and the data transmitted to the stream manager 134. The countscan be further used to determine the frequency. After the frequency ofan attribute value is determined, the method 700 can continue tooperation 714.

In operation 714, the stream operator can receive a frequency thresholdvalue. The frequency threshold value can be a minimum or a maximumfrequency. For example, the frequency threshold value can be any timemore than 15 instances of the attribute value “juniper” appears out of30 attributes. Thus, anytime that the frequency is higher than 15instances, the value can meet the threshold. A minimum can beestablished in order for the application to select a sentinel value thatappears more frequently. A sentinel value that appears more frequentlycould potentially have shorter, but more frequent windowing operations.

In other instances, a maximum frequency threshold value can be set. Forexample, an application can set the frequency threshold value so thatthe frequency is under 15 instances of the attribute value “juniper” outof 30 instances. A maximum frequency threshold value can be set when anapplication does not desire too many instances of a particular sentinelvalue. A sentinel value that appears infrequently can have longerwindows because the number of attributes between the sentinel values isgreater than if the sentinel value appeared frequently.

In operation 716, the streams manager 134 can determine if the frequencyof the attribute value is within a threshold. For example, if, inoperation 712, the frequency of the attribute value “juniper” occurs in16 instances out of 30 instances, then the threshold value can be met ifthe frequency threshold value is at least 15 instances out of 30instances for the attribute value “juniper”. If the frequency of theattribute value is not within the threshold value, then the method 700can continue to operation 710.

A sentinel value may not be detected within a period of time in what canbe referred to as a detection timeout. In a detection timeout, thestream manager 134 can define a particular time period necessary todetect a sentinel value. The absence of a detection value can triggerthe detection timeout. Possible responses to the detection timeout caninclude modifying the sentinel value to increase a frequency ofdetection. The sentinel value can be modified by adjusting the frequencythreshold. The sentinel value can also be modified by defining thesentinel value at the application level. The sentinel value can bedefined to include a certain term that appears more frequently. If thefrequency of the attribute value is within the threshold value, then themethod 700 can continue to operation 718.

In operation 718, the stream manager 134 can select the attribute valueas the sentinel value. In various embodiments, the sentinel value canalso be determined by application preferences.

FIG. 8 illustrates a block diagram of an operator graph 800 thatimplements a windowing operation in response to a sentinel value,according to various embodiments. The operator graph 800 can be used inthe context of processing data from a forest survey. The forest surveyexample will be used through the discussion for operator graph 800 toillustrate the concepts discussed herein.

The operator graph 800 can have a stream operator 805. The streamoperator 805 can be a stream operator that produces an average for acertain type of tree, e.g., a Juniper tree, in a grouping window. Thestream operator 805 can receive a stream of tuples from a source 135.The stream operator 805 can perform a processing operation, e.g.,performing an average for Juniper trees. A windowing operation can occurat stream operator 805 in order to isolate particular attribute values.The stream operator 805 can send a count for the attributes within thewindow to an aggregate stream operator 807. The aggregate streamoperator 807 can receive counts from multiple counting stream operators,e.g., 805 and 809, and add them together. The resulting count ofattributes can be sent to a sink 825.

The stream operator 805 can also implement an action, or specifically,an action to initiate the windowing operation. The action can cause thestream operator 805 to react to a particular sentinel value or aninitiation condition. As mentioned herein, the sentinel value is a valuethat initiates a windowing operation. For the purposes of illustration,the initiatation condition can be based on a single sentinel value andcan be used to initiate a grouping window. In this example, theinitiation condition provides that if the sentinel value of “Juniper” isfound and the 5 values of the tree attribute preceding the value“Juniper” are not blank, then the windowing operation can be initiated.In various embodiments, whether the 5 values preceding the “Juniper”value are not blank can be determined by maintaining a buffer within thestream operator 805. For example, stream operator 805 can maintain ahistory of the last 5 values in a buffer as to whether the last 5attribute values are blank.

The tuples received for the tree attribute are listed in table 810.Table 810 lists the tuples in the order that they are received and donot necessarily indicate a memory on the part of the operator graph 800.The table 810 shows only the attribute for “tree” but more attributescan be received by the stream operator 805. The tree attribute can haveattribute values, e.g., elm, maple, juniper, pine, etc. As anillustration, the 5th tuple received by the stream operator 805 can havethe attribute value of “dutch elm”.

As the stream of tuples are received, the stream operator 805 monitorseach attribute of the tuple for the sentinel value. If the sentinelvalue is “juniper”, then the sentinel value will not be detected untilthe sixth tuple. Once the sentinel value is detected by the streamoperator 805, the stream operator 805 can communicate the detection tothe windowing manager 145. The windowing manager 145 can instruct thestream operator 805 to initiate the windowing operation. As an example,the stream operator 805 can be configured to count the values of theattribute value “pine”. In the windowing operation, the stream operator805 can count the attribute value “pine” two times in the window thatbegan with the sentinel value juniper. There can be various reasons forusing the sentinel value “juniper” to initiate a window that counts thenumber of instances of “pine”. For example, a forestry researcher canobserve that the presence of juniper trees is indicative of a particularecosystem.

In various embodiments, the stream operator 805 can divert a portion ofthe stream of tuples, i.e., the grouping window, to an alternate path.Although not illustrated, the windowing operation can allow for theseparation of the grouping window from the stream of tuples and theregular processing path. The alternate path can take the tuples in thegrouping window and perform an alternate processing compared toprocessing performed by stream operator 805, and stream operator 807.

The windowing operation can occur until the stream operator 805 receivesa terminating sentinel value. For example, the presence of an oak treecan indicate another type of ecosystem and the application can assign“oak” as a terminating sentinel value. Once the presence of theterminating sentinel value is detected, then the window in the windowingoperation is closed. In various embodiments, the count can be finalizedonce the window is closed. The stream operator 805 can perform anaveraging operation for Juniper within the grouping window, whichcontains three values, and transmit the average of 0.33 to the streamoperator 807. The stream operator 807 can perform more averaging ofmultiple windows from stream operators such as stream operator 809 andcan transmit an aggregate value to the sink 825.

In the foregoing, reference is made to various embodiments. It should beunderstood, however, that this disclosure is not limited to thespecifically described embodiments. Instead, any combination of thedescribed features and elements, whether related to differentembodiments or not, is contemplated to implement and practice thisdisclosure. Furthermore, although embodiments of this disclosure mayachieve advantages over other possible solutions or over the prior art,whether or not a particular advantage is achieved by a given embodimentis not limiting of this disclosure. Thus, the described aspects,features, embodiments, and advantages are merely illustrative and arenot considered elements or limitations of the appended claims exceptwhere explicitly recited in a claim(s).

Aspects of the present disclosure may be embodied as a system, method,or computer program product. Accordingly, aspects of the presentdisclosure may take the form of an entirely hardware embodiment, anentirely software embodiment (including firmware, resident software,micro-code, etc.), or an embodiment combining software and hardwareaspects that may all generally be referred to herein as a “circuit,”“module,” or “system.” Furthermore, aspects of the present disclosuremay take the form of a computer program product embodied in one or morecomputer readable medium(s) having computer readable program codeembodied thereon.

Any combination of one or more computer readable medium(s) may beutilized. The computer readable medium may be a computer readable signalmedium or a computer readable storage medium. A computer readablestorage medium may be, for example, but not limited to, an electronic,magnetic, optical, electromagnetic, infrared, or semiconductor system,apparatus, or device, or any suitable combination thereof. More specificexamples (a non-exhaustive list) of the computer readable storage mediumwould include the following: an electrical connection having one or morewires, a portable computer diskette, a hard disk, a random access memory(RAM), a read-only memory (ROM), an erasable programmable read-onlymemory (EPROM or Flash memory), an optical fiber, a portable compactdisc read-only memory (CD-ROM), an optical storage device, a magneticstorage device, or any suitable combination thereof. In the context ofthis disclosure, a computer readable storage medium may be any tangiblemedium that can contain, or store, a program for use by or in connectionwith an instruction execution system, apparatus, or device.

A computer readable signal medium may include a propagated data signalwith computer readable program code embodied therein, for example, inbaseband or as part of a carrier wave. Such a propagated signal may takeany of a variety of forms, including, but not limited to,electro-magnetic, optical, or any suitable combination thereof. Acomputer readable signal medium may be any computer readable medium thatis not a computer readable storage medium and that can communicate,propagate, or transport a program for use by or in connection with aninstruction execution system, apparatus, or device.

Program code embodied on a computer readable medium may be transmittedusing any appropriate medium, including but not limited to wireless,wire line, optical fiber cable, RF, etc., or any suitable combinationthereof.

Computer program code for carrying out operations for aspects of thepresent disclosure may be written in any combination of one or moreprogramming languages, including: (a) an object oriented programminglanguage; (b) conventional procedural programming languages; and (c) astreams programming language, such as IBM Streams Processing Language(SPL). The program code may execute as specifically described herein. Inaddition, the program code may execute entirely on the user's computer,partly on the user's computer, as a stand-alone software package, partlyon the user's computer and partly on a remote computer, or entirely onthe remote computer or server. In the latter scenario, the remotecomputer may be connected to the user's computer through any type ofnetwork, including a local area network (LAN) or a wide area network(WAN), or the connection may be made to an external computer (forexample, through the Internet using an Internet Service Provider).

Aspects of the present disclosure have been described with reference toflowchart illustrations, block diagrams, or both, of methods,apparatuses (systems), and computer program products according toembodiments of this disclosure. It will be understood that each block ofthe flowchart illustrations or block diagrams, and combinations ofblocks in the flowchart illustrations or block diagrams, can beimplemented by computer program instructions. These computer programinstructions may be provided to a processor of a general purposecomputer, special purpose computer, or other programmable dataprocessing apparatus to produce a machine, such that the instructions,which execute via the processor of the computer or other programmabledata processing apparatus, create means for implementing the functionsor acts specified in the flowchart or block diagram block or blocks.

These computer program instructions may also be stored in a computerreadable medium that can direct a computer, other programmable dataprocessing apparatus, or other devices to function in a particularmanner, such that the instructions stored in the computer readablemedium produce an article of manufacture including instructions whichimplement the function or act specified in the flowchart or blockdiagram block or blocks.

The computer program instructions may also be loaded onto a computer,other programmable data processing apparatus, or other devices to causea series of operational steps to be performed on the computer, otherprogrammable apparatus, or other devices to produce a computerimplemented process such that the instructions which execute on thecomputer or other programmable apparatus provide processes forimplementing the functions or acts specified in the flowchart or blockdiagram block or blocks.

Embodiments according to this disclosure may be provided to end-usersthrough a cloud-computing infrastructure. Cloud computing generallyrefers to the provision of scalable computing resources as a serviceover a network. More formally, cloud computing may be defined as acomputing capability that provides an abstraction between the computingresource and its underlying technical architecture (e.g., servers,storage, networks), enabling convenient, on-demand network access to ashared pool of configurable computing resources that can be rapidlyprovisioned and released with minimal management effort or serviceprovider interaction. Thus, cloud computing allows a user to accessvirtual computing resources (e.g., storage, data, applications, and evencomplete virtualized computing systems) in “the cloud,” without regardfor the underlying physical systems (or locations of those systems) usedto provide the computing resources.

Typically, cloud-computing resources are provided to a user on apay-per-use basis, where users are charged only for the computingresources actually used (e.g., an amount of storage space used by a useror a number of virtualized systems instantiated by the user). A user canaccess any of the resources that reside in the cloud at any time, andfrom anywhere across the Internet. In context of the present disclosure,a user may access applications or related data available in the cloud.For example, the nodes used to create a stream computing application maybe virtual machines hosted by a cloud service provider. Doing so allowsa user to access this information from any computing system attached toa network connected to the cloud (e.g., the Internet).

The flowchart and block diagrams in the figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods, and computer program products according to variousembodiments of the present disclosure. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof code, which comprises one or more executable instructions forimplementing the specified logical function(s). It should also be notedthat, in some alternative implementations, the functions noted in theblock may occur out of the order noted in the figures. For example, twoblocks shown in succession may, in fact, be executed substantiallyconcurrently, or the blocks may sometimes be executed in the reverseorder, depending upon the functionality involved. It will also be notedthat each block of the block diagrams or flowchart illustration, andcombinations of blocks in the block diagrams or flowchart illustration,can be implemented by special purpose hardware-based systems thatperform the specified functions or acts, or combinations of specialpurpose hardware and computer instructions.

Although embodiments are described within the context of a streamcomputing application, this is not the only context relevant to thepresent disclosure. Instead, such a description is without limitationand is for illustrative purposes only. Additional embodiments may beconfigured to operate with any computer system or application capable ofperforming the functions described herein. For example, embodiments maybe configured to operate in a clustered environment with a standarddatabase processing application. A multi-nodal environment may operatein a manner that effectively processes a stream of tuples. For example,some embodiments may include a large database system, and a query of thedatabase system may return results in a manner similar to a stream ofdata.

While the foregoing is directed to exemplary embodiments, other andfurther embodiments of the disclosure may be devised without departingfrom the basic scope thereof, and the scope thereof is determined by theclaims that follow.

1. A method for grouping processing of a stream of tuples, each tuplecontaining one or more attributes, comprising: receiving the stream oftuples to be processed by a plurality of processing elements operatingon one or more computer processors; determining a sentinel value thatdefines a start of a grouping window for the stream of tuples and aterminating sentinel value that defines an end of the grouping windowbased upon an attribute from the one or more attributes contained in thestream of tuples; monitoring the stream of tuples for the sentinel valueand the terminating sentinel value; initiating a windowing operationthat defines the start of the grouping window at the processing elementfrom the plurality of processing elements in response to detecting apresence of the sentinel value; and terminating the windowing operationat the processing element in response to detecting a presence of theterminating sentinel value.
 2. The method of claim 1, wherein themonitoring the stream of tuples includes: determining a presence of atiming error between a plurality of tuples from the stream of tuples;and discarding a tuple from the plurality of tuples in response to thepresence of the timing error and the timing error being outside of atolerance level.
 3. The method of claim 1, the determining a sentinelvalue further comprising: examining an attribute from each tuple fromthe stream of tuples; determining a frequency of the attribute in thestream of tuples; determining whether the frequency of the attribute isoutside of a frequency threshold; and selecting the attribute as thesentinel value in response to determining that the frequency of theattribute is outside of the frequency threshold.
 4. The method of claim1, wherein initiating a windowing operation includes: determiningwhether a timeout condition is met; and modifying the sentinel value inresponse to determining that the timeout condition is met.
 5. The methodof claim 1, wherein the determining of the sentinel value includes:determining the sentinel value from a plurality of attributes within thestream of tuples, wherein a first one of the plurality of attributes isin a first tuple in the stream of tuples and a second one of theplurality of attributes is in a second tuple in the stream of tuples. 6.The method of claim 1, wherein the determining of the sentinel valueincludes determining the sentinel value from a plurality of attributeswithin the stream of tuples, wherein a first one and a second one of theplurality of attributes is in a first tuple in the stream of tuples. 7.The method of claim 1, wherein the determining of the presence of thesentinel value includes: determining the presence of the sentinel valuefrom a first tuple in the stream of tuples; and including the firsttuple in the grouping window.
 8. The method of claim 1, wherein theplurality of processing elements operating on one or more computerprocessors define an operator graph having a first path for processingthe stream of tuples and the initiating the windowing operation includesprocessing tuples within the grouping window through an alternate path.9-18. (canceled)